<?php

class TasksService
{    
	protected $_model;

	public function __construct()
	{
		$this->_model = $this->_getModel();
	}
 
 	protected function _getModel()
    {
		if (null === $this->_model) {
			require_once APPLICATION_PATH . '/models/TaskModel.php';
            $this->_model = new Model_TaskModel();
        }
        return $this->_model;
    }
  
	public function getTasksByUser($currUser)
	{
		$arr = $this->_model->fetchEntriesByUser($currUser);
		return $arr;        
	}

	public function getTasksByGoalAndUser($currGoal)
	{
		$arr = $this->_model->fetchEntriesByGoal($currGoal);
		return $arr;        
	}
}